package edu.gyc.appshiro.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

@Data
public class UserRoleVo {
    private Integer uid;
    private String description;
    private String role;
    private String username;

    @TableField(exist = false)
    private Set<String> roleSet = new HashSet<>();

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserRoleVo that = (UserRoleVo) o;
        return username.equals(that.username);
    }

    @Override
    public int hashCode() {
        return Objects.hash(username);
    }

    @TableField(exist = false)
    private String rolenames;
}
